<%--
  Created by IntelliJ IDEA.
  User: suncong
  Date: 2020/8/17
  Time: 15:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <style>
        .box {
            width: 600px;
            margin: 0 auto;
            background-color: #dcdcdc;
        }

        .beamPortalDataGrid {
            background: none;
            font-size: 12px;
            padding-bottom: 0px;
            padding-left: 0px;
            text-decoration: none;
            border-bottom: 1px solid #e7eaec;
            height: 34px !important;
            line-height: 34px;
        }

        .beamPortalDataGridLink {
            float: right;
            color: #166f6e !important;
            margin-right: 15px;
            padding-top: 3px;
            clear: both;
            text-decoration: underline;
        }

        #sparePartExpiresContext li {
            white-space: nowrap;
        }
    </style>
</head>
<body>
<div id="reminderPend" class="rowItemDiv" style="min-height: 68px;">
    <div class="box">
        <table width="600px" cellpadding="0" cellspacing="0">
            <tbody>
            <tr>
                <td id="reminderPendContext">
                    <div class="port-panes">
                        <span style="margin-left: 20px;pxfont-size: 12px;"><a href="/saveEdit" name="Add">新增</a><br/></span>
                        <div id="content" style=" margin: auto; display:block;"></div>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
    //加载数据
    getData();

    /**
     * 请求数据
     */
    function getData(params) {
        $.ajax({
            url: "/resumeListData",
            type: 'get',
            async: true,
            dataType: "json",
            contentType: "application/json",
            success: function (data) {
                var contentHtml = '<li class="beamPortalDataGrid"><span style = "margin-right:80px;text-align:center" ><b>姓名</b></span><span style = "margin-right:80px;text-align:center" ><b>地址</b></span><span style = "margin-right:120px;text-align:center" ><b>电话</b></span><span style = "margin-right:80px;text-align:center" ><b>编辑</b></span><span style = "margin-right:0px;text-align:center" ><b>删除</b></span></li>';
                if (data.length > 0) {
                    $.each(data, function (index, value) {
                        var id = "";
                        var name = "";
                        var address = "";
                        var phone = "";
                        if (value) {
                            id = value.id;
                            name = value.name;
                            address = value.address;
                            phone = value.phone;
                            contentHtml += '<li onclick = "" style="height: 34px;" class="beamPortalDataGrid">';
                            contentHtml += '<span style = "margin-right:80px;text-align:center" >' + name + '</span>';
                            contentHtml += '<span style = "margin-right:80px;text-align:center" >' + address + '</span>';
                            contentHtml += '<span style = "margin-right:80px;text-align:center" >' + phone + '</span>';
                            contentHtml += '<span style = "margin-right:80px;text-align:center" ><a href="/saveEdit?id=' + id + '" name="Modify">编辑</a></span>';
                            contentHtml += '<span style = "margin-right:0px;text-align:center" ><a href="/delete?id=' + id + '" name="Delete">删除</a></span>';
                            contentHtml += '</li>';
                        }
                    });
                }
                contentHtml = '<ul class="port-list">' + contentHtml + '</ul>';
                $('#content').html(contentHtml);
            }
        });
    }
</script>
</body>
</html>
